var util = require('../../utils/util.js')
Page({
  data: {
    text: []
  },
  replaceCharacters : function(text){
      text = text.replace(/<p>/g,'');
      text = text.replace(/<\/p>/g,'\n');
      return text;
  },
  onLoad: function (options) {
    console.log(options);
    var that = this
    wx.request({
      url: 'http://localhost:8080/home/listContent',
      data : {
        sectionId : options.id
      },
      success : function(res){
        var text = that.replaceCharacters(res.data);
        that.setData({text : text});
      }
    });
  }
})